// Copyright (C) 2013 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-typeof-operator-runtime-semantics-evaluation
description: typeof Symbol() and Object(Symbol)
info: |
  The typeof Operator

  Runtime Semantics: Evaluation

    ...
    Return a String according to Table 35.

  #table-35

  Symbol "symbol"
  Object(Symbol()) "object"

features: [Symbol]
---*/

function Test() {
    assert.sameValue(
      typeof Symbol(),
      "symbol",
      "typeof Symbol() === 'symbol'"
    );

    assert.sameValue(
      typeof Symbol("A"),
      "symbol",
      "typeof Symbol('A') === 'symbol'"
    );

    assert.sameValue(
      typeof Object(Symbol()),
      "object",
      "typeof Object(Symbol()) === 'object'"
    );

    assert.sameValue(
      typeof Object(Symbol("A")),
      "object",
      "typeof Object(Symbol('A')) === 'object'"
    );

}

// preheat
const NUMBER_OF_PREHEAT = 1;
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}

ArkTools.jitCompileAsync(Test);
assert.sameValue(ArkTools.waitJitCompileFinish(Test), true, '[JIT] JIT disabled.');

// test
const NUMBER_OF_TEST = 1; // or 2
for (let i = 0; i < NUMBER_OF_TEST; i++) {
    Test();
}
